<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 3. 导入bootstrap的js文件 -->

    <link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
    <%--<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->--%>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
    <title>Title</title>
    <style>
        td, th {
            text-align: center;
        }
        #form tr:hover {
            background-color: #f5f5f5;
        }
     *, html ,body{
         background-color: rgb(246,246,246);
      }

    </style>
    <script>
         function delectBlogBiaoQian(id) {
             // alert(id);
           //用户安全提示
            if (confirm("您确定要删除吗？")) {
                 //访问路径
                location.href = "${pageContext.request.contextPath}/youlian/delete?id=" + id;
             }
         }

    </script>
</head>
<body>
<div>
    <h3 style="text-align: center">友链管理</h3>

    <form id="form" action="#" method="post">
        <table border="1" class="table table-bordered table-hover ">
            <tr class="success">

                <th>编号</th>
                <th>友链地址</th>
                <th>操作</th>
            </tr>
            <tbody>
            <c:forEach items="${sessionScope.youlian}" var="t" varStatus="s">
                <tr>


                    <td>${s.count}</td>

                    <td>${t.dizhi}</td>

                    <td>
                            <%--<c:if test="${sessionScope.uesr.name}eq${t.actor}">--%>
                            <%----%>
                            <%--</c:if>--%>

                        <%--<a class="btn btn-default btn-sm"--%>
                           <%--href="${pageContext.request.contextPath}/findBlogServlet?id=${t.q_id}">修改</a>&nbsp;--%>
                                <a
                                        class="btn btn-success btn-sm"
                                href="javascript:delectBlogBiaoQian(${t.y_id});">删除

                                    <%--href="${pageContext.request.contextPath}/DelSelectedBlogBiaoQianServlet?id=${t.q_id}">删除--%>
                        </a>

                    </td>
                </tr>

            </c:forEach>
            </tbody>
        </table>
    </form>
    <div style="clear:right;float: left">
        <form class="form-inline" action="${pageContext.request.contextPath}/youlian/insert" method="post">
            <div class="form-group">
                <label for="exampleInputName2">添加网址名字:</label>
                <input type="text" name="name" class="form-control" id="exampleInputName2" placeholder="百度一下">
            </div>
            <div class="form-group">
                <label for="exampleInputName3">添加网址地址:</label>
                <input type="text" name="dizhi" class="form-control" id="exampleInputName3" placeholder="www.baidu.com">
            </div>

            <button type="submit" class="btn btn-default">添加</button>
        </form>
    </div>
    <div style="clear:right;float: right;margin-right: 5px">
        <%--<a class="btn btn-primary" href="addTalk.jsp">添加留言</a>--%>
        <%--<a class="btn btn-primary" href="${pageContext.request.contextPath}/two.jsp" id="delSelectedAll">发布文章</a>--%>
    </div>
</div>
</body>
</html>
